/*
  ==============================================================================

  This is an automatically generated file created by the Jucer!

  Creation date:  14 Sep 2011 10:43:42am

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Jucer version: 1.12

  ------------------------------------------------------------------------------

  The Jucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-6 by Raw Material Software ltd.

  ==============================================================================
*/

//[Headers] You can add your own extra header files here...
//[/Headers]

#include "AudioToCCEditor.h"


//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]

//==============================================================================
AudioToCCEditor::AudioToCCEditor (AudioToCC* const ownerFilter)
    : AudioProcessorEditor (ownerFilter),
      s_Thresh (0),
      label20 (0),
      clipR (0),
      clipL (0),
      comboBox (0),
      s_LCC (0),
      s_RCC (0),
      s_Channel (0),
      b_Stereo (0),
      s_Rate (0),
      s_Inertia (0),
      label (0),
      label2 (0),
      label3 (0),
      label4 (0),
      label5 (0),
      label6 (0),
      s_Gain (0),
      label7 (0),
      s_IndicatorL (0),
      s_IndicatorR (0),
      toggleButton (0),
      toggleButton2 (0),
      s_Attack (0),
      s_Release (0),
      label8 (0),
      label9 (0),
      b_Mode (0),
      label10 (0),
      label11 (0),
      label12 (0),
      s_GateLCC (0),
      s_GateCCR (0),
      label13 (0),
      label14 (0),
      s_OnValueL (0),
      s_OnValueR (0),
      label15 (0),
      label16 (0),
      s_OffValueL (0),
      s_OffValueR (0),
      label17 (0),
      label18 (0),
      label19 (0),
      s_PeakGain (0),
      s_IndicatorRIn (0),
      s_IndicatorLIn (0)
{
    addAndMakeVisible (s_Thresh = new DecibelSlider (L"slider"));
    s_Thresh->setRange (0, 1, 0);
    s_Thresh->setSliderStyle (Slider::LinearBar);
    s_Thresh->setTextBoxStyle (Slider::TextBoxBelow, true, 80, 20);
    s_Thresh->addListener (this);
    s_Thresh->setSkewFactor (0.6);

    addAndMakeVisible (label20 = new Label (L"new label",
                                            L"Peak"));
    label20->setFont (Font (12.0000f, Font::plain));
    label20->setJustificationType (Justification::centred);
    label20->setEditable (false, false, false);
    label20->setColour (TextEditor::textColourId, Colours::black);
    label20->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (clipR = new TextButton (L"new button"));
    clipR->setButtonText (L"gate");
    clipR->setConnectedEdges (Button::ConnectedOnLeft);
    clipR->addListener (this);
    clipR->setColour (TextButton::buttonOnColourId, Colour (0xffc33333));
    clipR->setColour (TextButton::textColourOnId, Colours::white);

    addAndMakeVisible (clipL = new TextButton (L"new button"));
    clipL->setButtonText (L"gate");
    clipL->setConnectedEdges (Button::ConnectedOnLeft);
    clipL->addListener (this);
    clipL->setColour (TextButton::buttonOnColourId, Colour (0xffc33333));
    clipL->setColour (TextButton::textColourOnId, Colours::white);
    clipL->setColour (TextButton::textColourOffId, Colours::black);

    addAndMakeVisible (comboBox = new ComboBox (L"new combo box"));
    comboBox->setTooltip (L"Output Device");
    comboBox->setEditableText (false);
    comboBox->setJustificationType (Justification::centredLeft);
    comboBox->setTextWhenNothingSelected (L"--");
    comboBox->setTextWhenNoChoicesAvailable (L"(no choices)");
    comboBox->addListener (this);

    addAndMakeVisible (s_LCC = new VSTSlider (L"LCC slider"));
    s_LCC->setRange (-1, 127, 1);
    s_LCC->setSliderStyle (Slider::LinearBar);
    s_LCC->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_LCC->addListener (this);

    addAndMakeVisible (s_RCC = new VSTSlider (L"RCC slider"));
    s_RCC->setRange (-1, 127, 1);
    s_RCC->setSliderStyle (Slider::LinearBar);
    s_RCC->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_RCC->addListener (this);

    addAndMakeVisible (s_Channel = new VSTSlider (L"channel slider"));
    s_Channel->setRange (1, 16, 1);
    s_Channel->setSliderStyle (Slider::LinearBar);
    s_Channel->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_Channel->addListener (this);

    addAndMakeVisible (b_Stereo = new TextButton (L"mono/stereo"));
    b_Stereo->setButtonText (L"Stereo");
    b_Stereo->addListener (this);
    b_Stereo->setColour (TextButton::buttonOnColourId, Colour (0xffbbbbff));

    addAndMakeVisible (s_Rate = new VSTSlider (L"rate slider"));
    s_Rate->setRange (0, 100, 1);
    s_Rate->setSliderStyle (Slider::RotaryVerticalDrag);
    s_Rate->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 16);
    s_Rate->addListener (this);

    addAndMakeVisible (s_Inertia = new VSTSlider (L"inertia slider"));
    s_Inertia->setRange (0, 100, 1);
    s_Inertia->setSliderStyle (Slider::RotaryVerticalDrag);
    s_Inertia->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 16);
    s_Inertia->addListener (this);

    addAndMakeVisible (label = new Label (L"new label",
                                          L"MIDI Out Device:"));
    label->setFont (Font (12.0000f, Font::plain));
    label->setJustificationType (Justification::centredLeft);
    label->setEditable (false, false, false);
    label->setColour (TextEditor::textColourId, Colours::black);
    label->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label2 = new Label (L"new label",
                                           L"RMS"));
    label2->setFont (Font (12.0000f, Font::plain));
    label2->setJustificationType (Justification::centred);
    label2->setEditable (false, false, false);
    label2->setColour (TextEditor::textColourId, Colours::black);
    label2->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label3 = new Label (L"new label",
                                           L"L CC:"));
    label3->setFont (Font (12.0000f, Font::plain));
    label3->setJustificationType (Justification::centredRight);
    label3->setEditable (false, false, false);
    label3->setColour (TextEditor::textColourId, Colours::black);
    label3->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label4 = new Label (L"new label",
                                           L"R CC:"));
    label4->setFont (Font (12.0000f, Font::plain));
    label4->setJustificationType (Justification::centredRight);
    label4->setEditable (false, false, false);
    label4->setColour (TextEditor::textColourId, Colours::black);
    label4->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label5 = new Label (L"new label",
                                           L"Ch:"));
    label5->setFont (Font (12.0000f, Font::plain));
    label5->setJustificationType (Justification::centredRight);
    label5->setEditable (false, false, false);
    label5->setColour (TextEditor::textColourId, Colours::black);
    label5->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label6 = new Label (L"new label",
                                           L"Rate"));
    label6->setFont (Font (12.0000f, Font::plain));
    label6->setJustificationType (Justification::centred);
    label6->setEditable (false, false, false);
    label6->setColour (TextEditor::textColourId, Colours::black);
    label6->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (s_Gain = new DecibelSlider (L"gain slider"));
    s_Gain->setRange (0, 32, 0);
    s_Gain->setSliderStyle (Slider::RotaryVerticalDrag);
    s_Gain->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 16);
    s_Gain->addListener (this);
    s_Gain->setSkewFactor (0.333);

    addAndMakeVisible (label7 = new Label (L"new label",
                                           L"Inertia"));
    label7->setFont (Font (12.0000f, Font::plain));
    label7->setJustificationType (Justification::centred);
    label7->setEditable (false, false, false);
    label7->setColour (TextEditor::textColourId, Colours::black);
    label7->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (s_IndicatorL = new Slider (L"new slider"));
    s_IndicatorL->setRange (0, 127, 1);
    s_IndicatorL->setSliderStyle (Slider::LinearBar);
    s_IndicatorL->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20);
    s_IndicatorL->setColour (Slider::backgroundColourId, Colours::black);
    s_IndicatorL->setColour (Slider::thumbColourId, Colour (0xff7e7434));
    s_IndicatorL->setColour (Slider::textBoxTextColourId, Colours::white);
    s_IndicatorL->addListener (this);

    addAndMakeVisible (s_IndicatorR = new Slider (L"new slider"));
    s_IndicatorR->setRange (0, 127, 1);
    s_IndicatorR->setSliderStyle (Slider::LinearBar);
    s_IndicatorR->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20);
    s_IndicatorR->setColour (Slider::backgroundColourId, Colours::black);
    s_IndicatorR->setColour (Slider::thumbColourId, Colour (0xff7e7434));
    s_IndicatorR->setColour (Slider::textBoxTextColourId, Colours::white);
    s_IndicatorR->addListener (this);

    addAndMakeVisible (toggleButton = new ToggleButton (L"new toggle button"));
    toggleButton->setButtonText (L"Automation to host");
    toggleButton->addListener (this);

    addAndMakeVisible (toggleButton2 = new ToggleButton (L"new toggle button"));
    toggleButton2->setButtonText (L"MIDI to host");
    toggleButton2->addListener (this);

    addAndMakeVisible (s_Attack = new VSTSlider (L"attack slider"));
    s_Attack->setRange (0, 100, 1);
    s_Attack->setSliderStyle (Slider::RotaryVerticalDrag);
    s_Attack->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 16);
    s_Attack->addListener (this);

    addAndMakeVisible (s_Release = new VSTSlider (L"release slider"));
    s_Release->setRange (0, 100, 1);
    s_Release->setSliderStyle (Slider::RotaryVerticalDrag);
    s_Release->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 16);
    s_Release->addListener (this);

    addAndMakeVisible (label8 = new Label (L"new label",
                                           L"Attack"));
    label8->setFont (Font (12.0000f, Font::plain));
    label8->setJustificationType (Justification::centred);
    label8->setEditable (false, false, false);
    label8->setColour (TextEditor::textColourId, Colours::black);
    label8->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label9 = new Label (L"new label",
                                           L"Release"));
    label9->setFont (Font (12.0000f, Font::plain));
    label9->setJustificationType (Justification::centred);
    label9->setEditable (false, false, false);
    label9->setColour (TextEditor::textColourId, Colours::black);
    label9->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (b_Mode = new TextButton (L"dB"));
    b_Mode->setButtonText (L"Logarithmic");
    b_Mode->addListener (this);
    b_Mode->setColour (TextButton::buttonOnColourId, Colour (0xffbbbbff));

    addAndMakeVisible (label10 = new Label (L"new label",
                                            L"Scale:"));
    label10->setFont (Font (12.0000f, Font::plain));
    label10->setJustificationType (Justification::centredRight);
    label10->setEditable (false, false, false);
    label10->setColour (TextEditor::textColourId, Colours::black);
    label10->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label11 = new Label (L"new label",
                                            L"L"));
    label11->setFont (Font (12.0000f, Font::plain));
    label11->setJustificationType (Justification::centredRight);
    label11->setEditable (false, false, false);
    label11->setColour (TextEditor::textColourId, Colours::black);
    label11->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label12 = new Label (L"new label",
                                            L"R"));
    label12->setFont (Font (12.0000f, Font::plain));
    label12->setJustificationType (Justification::centredRight);
    label12->setEditable (false, false, false);
    label12->setColour (TextEditor::textColourId, Colours::black);
    label12->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (s_GateLCC = new VSTSlider (L"LCC slider"));
    s_GateLCC->setRange (-1, 127, 1);
    s_GateLCC->setSliderStyle (Slider::LinearBar);
    s_GateLCC->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_GateLCC->addListener (this);

    addAndMakeVisible (s_GateCCR = new VSTSlider (L"RCC slider"));
    s_GateCCR->setRange (-1, 127, 1);
    s_GateCCR->setSliderStyle (Slider::LinearBar);
    s_GateCCR->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_GateCCR->addListener (this);

    addAndMakeVisible (label13 = new Label (L"new label",
                                            L"Gate L CC:"));
    label13->setFont (Font (12.0000f, Font::plain));
    label13->setJustificationType (Justification::centredRight);
    label13->setEditable (false, false, false);
    label13->setColour (TextEditor::textColourId, Colours::black);
    label13->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label14 = new Label (L"new label",
                                            L"Gate R CC:"));
    label14->setFont (Font (12.0000f, Font::plain));
    label14->setJustificationType (Justification::centredRight);
    label14->setEditable (false, false, false);
    label14->setColour (TextEditor::textColourId, Colours::black);
    label14->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (s_OnValueL = new VSTSlider (L"LCC slider"));
    s_OnValueL->setRange (-1, 127, 1);
    s_OnValueL->setSliderStyle (Slider::LinearBar);
    s_OnValueL->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_OnValueL->addListener (this);

    addAndMakeVisible (s_OnValueR = new VSTSlider (L"RCC slider"));
    s_OnValueR->setRange (-1, 127, 1);
    s_OnValueR->setSliderStyle (Slider::LinearBar);
    s_OnValueR->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_OnValueR->addListener (this);

    addAndMakeVisible (label15 = new Label (L"new label",
                                            L"On Value L:"));
    label15->setFont (Font (12.0000f, Font::plain));
    label15->setJustificationType (Justification::centredRight);
    label15->setEditable (false, false, false);
    label15->setColour (TextEditor::textColourId, Colours::black);
    label15->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label16 = new Label (L"new label",
                                            L"On Value R:"));
    label16->setFont (Font (12.0000f, Font::plain));
    label16->setJustificationType (Justification::centredRight);
    label16->setEditable (false, false, false);
    label16->setColour (TextEditor::textColourId, Colours::black);
    label16->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (s_OffValueL = new VSTSlider (L"LCC slider"));
    s_OffValueL->setRange (-1, 127, 1);
    s_OffValueL->setSliderStyle (Slider::LinearBar);
    s_OffValueL->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_OffValueL->addListener (this);

    addAndMakeVisible (s_OffValueR = new VSTSlider (L"RCC slider"));
    s_OffValueR->setRange (-1, 127, 1);
    s_OffValueR->setSliderStyle (Slider::LinearBar);
    s_OffValueR->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    s_OffValueR->addListener (this);

    addAndMakeVisible (label17 = new Label (L"new label",
                                            L"Off Value L:"));
    label17->setFont (Font (12.0000f, Font::plain));
    label17->setJustificationType (Justification::centredRight);
    label17->setEditable (false, false, false);
    label17->setColour (TextEditor::textColourId, Colours::black);
    label17->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label18 = new Label (L"new label",
                                            L"Off Value R:"));
    label18->setFont (Font (12.0000f, Font::plain));
    label18->setJustificationType (Justification::centredRight);
    label18->setEditable (false, false, false);
    label18->setColour (TextEditor::textColourId, Colours::black);
    label18->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (label19 = new Label (L"new label",
                                            L"Threshold:"));
    label19->setFont (Font (12.0000f, Font::plain));
    label19->setJustificationType (Justification::centredRight);
    label19->setEditable (false, false, false);
    label19->setColour (TextEditor::textColourId, Colours::black);
    label19->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (s_PeakGain = new DecibelSlider (L"gain slider"));
    s_PeakGain->setRange (0, 32, 0);
    s_PeakGain->setSliderStyle (Slider::RotaryVerticalDrag);
    s_PeakGain->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 16);
    s_PeakGain->addListener (this);
    s_PeakGain->setSkewFactor (0.333);

    addAndMakeVisible (s_IndicatorRIn = new DecibelMeter (L"new slider"));
    s_IndicatorRIn->setRange (0, 1, 0);
    s_IndicatorRIn->setSliderStyle (Slider::LinearBar);
    s_IndicatorRIn->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20);
    s_IndicatorRIn->setColour (Slider::backgroundColourId, Colours::black);
    s_IndicatorRIn->setColour (Slider::thumbColourId, Colour (0xff347e4c));
    s_IndicatorRIn->setColour (Slider::textBoxTextColourId, Colours::white);
    s_IndicatorRIn->addListener (this);
    s_IndicatorRIn->setSkewFactor (0.6);

    addAndMakeVisible (s_IndicatorLIn = new DecibelMeter (L"new slider"));
    s_IndicatorLIn->setRange (0, 1, 0);
    s_IndicatorLIn->setSliderStyle (Slider::LinearBar);
    s_IndicatorLIn->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20);
    s_IndicatorLIn->setColour (Slider::backgroundColourId, Colours::black);
    s_IndicatorLIn->setColour (Slider::thumbColourId, Colour (0xff347e4c));
    s_IndicatorLIn->setColour (Slider::textBoxTextColourId, Colours::white);
    s_IndicatorLIn->addListener (this);
    s_IndicatorLIn->setSkewFactor (0.6);


    //[UserPreSize]
	setMouseClickGrabsKeyboardFocus(false);
    StringArray devices = ownerFilter->devices;

    s_LCC->setMouseClickGrabsKeyboardFocus(false);
    s_RCC->setMouseClickGrabsKeyboardFocus(false);
    s_Channel->setMouseClickGrabsKeyboardFocus(false);
    s_Rate->setMouseClickGrabsKeyboardFocus(false);
    s_Inertia->setMouseClickGrabsKeyboardFocus(false);
    s_Gain->setMouseClickGrabsKeyboardFocus(false);
    s_Attack->setMouseClickGrabsKeyboardFocus(false);
    s_Release->setMouseClickGrabsKeyboardFocus(false);
    label->setMouseClickGrabsKeyboardFocus(false);
    label2->setMouseClickGrabsKeyboardFocus(false);
    label3->setMouseClickGrabsKeyboardFocus(false);
    label4->setMouseClickGrabsKeyboardFocus(false);
    label5->setMouseClickGrabsKeyboardFocus(false);
    label6->setMouseClickGrabsKeyboardFocus(false);
    label7->setMouseClickGrabsKeyboardFocus(false);
    label8->setMouseClickGrabsKeyboardFocus(false);
    label9->setMouseClickGrabsKeyboardFocus(false);
    label10->setMouseClickGrabsKeyboardFocus(false);
    label11->setMouseClickGrabsKeyboardFocus(false);
    label12->setMouseClickGrabsKeyboardFocus(false);
    s_IndicatorL->setMouseClickGrabsKeyboardFocus(false);
    s_IndicatorR->setMouseClickGrabsKeyboardFocus(false);
    b_Stereo->setMouseClickGrabsKeyboardFocus(false);
    b_Mode->setMouseClickGrabsKeyboardFocus(false);
    toggleButton->setMouseClickGrabsKeyboardFocus(false);
    toggleButton2->setMouseClickGrabsKeyboardFocus(false);
	comboBox->setMouseClickGrabsKeyboardFocus(false);
    s_GateLCC->setMouseClickGrabsKeyboardFocus(false);
    s_GateCCR->setMouseClickGrabsKeyboardFocus(false);
    s_OnValueL->setMouseClickGrabsKeyboardFocus(false);
    s_OnValueR->setMouseClickGrabsKeyboardFocus(false);
    s_OffValueL->setMouseClickGrabsKeyboardFocus(false);
    s_OffValueR->setMouseClickGrabsKeyboardFocus(false);
    s_Thresh->setMouseClickGrabsKeyboardFocus(false);
    s_IndicatorLIn->setMouseClickGrabsKeyboardFocus(false);
    s_IndicatorRIn->setMouseClickGrabsKeyboardFocus(false);
    label13->setMouseClickGrabsKeyboardFocus(false);
    label14->setMouseClickGrabsKeyboardFocus(false);
    label15->setMouseClickGrabsKeyboardFocus(false);
    label16->setMouseClickGrabsKeyboardFocus(false);
    label17->setMouseClickGrabsKeyboardFocus(false);
    label18->setMouseClickGrabsKeyboardFocus(false);
    label19->setMouseClickGrabsKeyboardFocus(false);
    clipR->setMouseClickGrabsKeyboardFocus(false);
    clipL->setMouseClickGrabsKeyboardFocus(false);

	s_IndicatorL->setInterceptsMouseClicks(false,false);
    s_IndicatorR->setInterceptsMouseClicks(false,false);
    s_IndicatorLIn->setInterceptsMouseClicks(false,false);
    s_IndicatorRIn->setInterceptsMouseClicks(false,false);

	s_LCC->setSliderSnapsToMousePosition(false);
	s_RCC->setSliderSnapsToMousePosition(false);
	s_Channel->setSliderSnapsToMousePosition(false);
    s_GateLCC->setSliderSnapsToMousePosition(false);
    s_GateCCR->setSliderSnapsToMousePosition(false);
    s_OnValueL->setSliderSnapsToMousePosition(false);
    s_OnValueR->setSliderSnapsToMousePosition(false);
    s_OffValueL->setSliderSnapsToMousePosition(false);
    s_OffValueR->setSliderSnapsToMousePosition(false);
    s_Thresh->setSliderSnapsToMousePosition(true);

	s_LCC->setOwner(getAudioProcessor(),kCCL);
	s_RCC->setOwner(getAudioProcessor(),kCCR);
    s_Channel->setOwner(getAudioProcessor(),kChannel);
    s_Rate->setOwner(getAudioProcessor(),kRate);
    s_Inertia->setOwner(getAudioProcessor(),kSmooth);
    //s_Gain->setOwner(getAudioProcessor(),kGain);
    s_Attack->setOwner(getAudioProcessor(),kAttack);
    s_Release->setOwner(getAudioProcessor(),kRelease);
    s_GateLCC->setOwner(getAudioProcessor(),kGateCCL);
    s_GateCCR->setOwner(getAudioProcessor(),kGateCCR);
    s_OnValueL->setOwner(getAudioProcessor(),kGateOnValueCCL);
    s_OnValueR->setOwner(getAudioProcessor(),kGateOnValueCCR);
    s_OffValueL->setOwner(getAudioProcessor(),kGateOffValueCCL);
    s_OffValueR->setOwner(getAudioProcessor(),kGateOffValueCCR);
    //s_Thresh->setOwner(getAudioProcessor(),kGateThreshold);

	s_Gain->setDoubleClickReturnValue(true,1.f);
	s_PeakGain->setDoubleClickReturnValue(true,1.f);

	b_Stereo->setClickingTogglesState(true);
	b_Mode->setClickingTogglesState(true);

    comboBox->addItem(L"--",1);
    for (int i=0;i<devices.size();i++) {
        comboBox->addItem(devices.joinIntoString("",i,1),i+2);
    }
    comboBox->setSelectedId(1);

	LookAndFeel::setDefaultLookAndFeel (&Look);
    //[/UserPreSize]

    setSize (528, 312);


    //[Constructor] You can add your own custom stuff here..
    ownerFilter->addChangeListener(this);
    updateParametersFromFilter();
	peakcounter=0;
    startTimer (50);
    //[/Constructor]
}

AudioToCCEditor::~AudioToCCEditor()
{
    //[Destructor_pre]. You can add your own custom destruction code here..
    getFilter()->removeChangeListener (this);
    //[/Destructor_pre]

    deleteAndZero (s_Thresh);
    deleteAndZero (label20);
    deleteAndZero (clipR);
    deleteAndZero (clipL);
    deleteAndZero (comboBox);
    deleteAndZero (s_LCC);
    deleteAndZero (s_RCC);
    deleteAndZero (s_Channel);
    deleteAndZero (b_Stereo);
    deleteAndZero (s_Rate);
    deleteAndZero (s_Inertia);
    deleteAndZero (label);
    deleteAndZero (label2);
    deleteAndZero (label3);
    deleteAndZero (label4);
    deleteAndZero (label5);
    deleteAndZero (label6);
    deleteAndZero (s_Gain);
    deleteAndZero (label7);
    deleteAndZero (s_IndicatorL);
    deleteAndZero (s_IndicatorR);
    deleteAndZero (toggleButton);
    deleteAndZero (toggleButton2);
    deleteAndZero (s_Attack);
    deleteAndZero (s_Release);
    deleteAndZero (label8);
    deleteAndZero (label9);
    deleteAndZero (b_Mode);
    deleteAndZero (label10);
    deleteAndZero (label11);
    deleteAndZero (label12);
    deleteAndZero (s_GateLCC);
    deleteAndZero (s_GateCCR);
    deleteAndZero (label13);
    deleteAndZero (label14);
    deleteAndZero (s_OnValueL);
    deleteAndZero (s_OnValueR);
    deleteAndZero (label15);
    deleteAndZero (label16);
    deleteAndZero (s_OffValueL);
    deleteAndZero (s_OffValueR);
    deleteAndZero (label17);
    deleteAndZero (label18);
    deleteAndZero (label19);
    deleteAndZero (s_PeakGain);
    deleteAndZero (s_IndicatorRIn);
    deleteAndZero (s_IndicatorLIn);


    //[Destructor]. You can add your own custom destruction code here..
    //[/Destructor]
}

//==============================================================================
void AudioToCCEditor::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    g.fillAll (Colour (0xffd8d8d8));

    g.setColour (Colours::white);
    g.fillRoundedRectangle (24.0f, 8.0f, 168.0f, 48.0f, 10.0000f);

    g.setColour (Colours::black);
    g.fillRoundedRectangle (32.0f, 16.0f, 152.0f, 32.0f, 10.0000f);

    g.setColour (Colour (0xffb6b6b6));
    g.fillRoundedRectangle (224.0f, 8.0f, 296.0f, 296.0f, 10.0000f);

    g.setColour (Colour (0xff9a9a9a));
    g.fillRoundedRectangle (363.0f, 82.0f, 149.0f, 214.0f, 10.0000f);

    g.setColour (Colour (0xff9a9a9a));
    g.fillRoundedRectangle (235.0f, 82.0f, 120.0f, 214.0f, 10.0000f);

    g.setColour (Colours::black);
    g.setFont (Font (15.0000f, Font::bold));
    g.drawText (L"Continuous",
                235, 76, 117, 30,
                Justification::centred, true);

    g.setColour (Colours::black);
    g.setFont (Font (15.0000f, Font::bold));
    g.drawText (L"Gate",
                363, 76, 149, 30,
                Justification::centred, true);

    g.setColour (Colours::white);
    g.setFont (Font (11.2000f, Font::bold));
    g.drawText (L"Insert Piz Here->",
                40, 16, 136, 16,
                Justification::centred, true);

    g.setColour (Colours::black);
    g.setFont (Font (15.0000f, Font::bold));
    g.drawText (L"MIDI",
                235, 2, 277, 30,
                Justification::centred, true);

    g.setColour (Colours::white);
    g.setFont (Font (15.0000f, Font::bold));
    g.drawText (L"AudioToCC",
                40, 26, 136, 24,
                Justification::centred, true);

    g.setColour (Colour (0xff9a9a9a));
    g.fillRoundedRectangle (24.0f, 66.0f, 168.0f, 110.0f, 10.0000f);

    g.setColour (Colours::black);
    g.setFont (Font (15.0000f, Font::bold));
    g.drawText (L"Gain",
                27, 60, 165, 30,
                Justification::centred, true);

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}

void AudioToCCEditor::resized()
{
    s_Thresh->setBounds (32, 182, 152, 45);
    label20->setBounds (112, 134, 72, 16);
    clipR->setBounds (183, 211, 33, 16);
    clipL->setBounds (183, 182, 33, 16);
    comboBox->setBounds (280, 41, 194, 16);
    s_LCC->setBounds (272, 104, 72, 16);
    s_RCC->setBounds (272, 128, 72, 16);
    s_Channel->setBounds (312, 61, 72, 16);
    b_Stereo->setBounds (400, 61, 72, 16);
    s_Rate->setBounds (248, 240, 40, 48);
    s_Inertia->setBounds (296, 240, 40, 48);
    label->setBounds (275, 29, 150, 8);
    label2->setBounds (32, 132, 72, 16);
    label3->setBounds (232, 104, 40, 16);
    label4->setBounds (232, 128, 40, 16);
    label5->setBounds (272, 61, 40, 16);
    label6->setBounds (248, 224, 40, 16);
    s_Gain->setBounds (32, 78, 72, 88);
    label7->setBounds (288, 224, 56, 16);
    s_IndicatorL->setBounds (32, 236, 152, 24);
    s_IndicatorR->setBounds (32, 262, 152, 24);
    toggleButton->setBounds (48, 288, 120, 16);
    toggleButton2->setBounds (384, 25, 88, 16);
    s_Attack->setBounds (248, 168, 40, 48);
    s_Release->setBounds (296, 168, 40, 48);
    label8->setBounds (240, 152, 56, 16);
    label9->setBounds (288, 152, 56, 16);
    b_Mode->setBounds (244, -21, 80, 16);
    label10->setBounds (196, -21, 46, 16);
    label11->setBounds (16, 240, 16, 16);
    label12->setBounds (16, 266, 16, 16);
    s_GateLCC->setBounds (432, 136, 72, 16);
    s_GateCCR->setBounds (432, 216, 72, 16);
    label13->setBounds (368, 136, 64, 16);
    label14->setBounds (368, 216, 64, 16);
    s_OnValueL->setBounds (432, 160, 72, 16);
    s_OnValueR->setBounds (432, 240, 72, 16);
    label15->setBounds (360, 160, 72, 16);
    label16->setBounds (360, 240, 72, 16);
    s_OffValueL->setBounds (432, 184, 72, 16);
    s_OffValueR->setBounds (432, 264, 72, 16);
    label17->setBounds (352, 184, 80, 16);
    label18->setBounds (352, 264, 80, 16);
    label19->setBounds (-1, 196, 64, 16);
    s_PeakGain->setBounds (112, 78, 72, 88);
    s_IndicatorRIn->setBounds (32, 211, 152, 16);
    s_IndicatorLIn->setBounds (32, 182, 152, 16);
    //[UserResized] Add your own custom resize handling here..
    //[/UserResized]
}

void AudioToCCEditor::sliderValueChanged (Slider* sliderThatWasMoved)
{
    //[UsersliderValueChanged_Pre]
    //[/UsersliderValueChanged_Pre]

    if (sliderThatWasMoved == s_Thresh)
    {
        //[UserSliderCode_s_Thresh] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kGateThreshold,(float)(s_Thresh->getValue()));
        //[/UserSliderCode_s_Thresh]
    }
    else if (sliderThatWasMoved == s_LCC)
    {
        //[UserSliderCode_s_LCC] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kCCL,s_LCC->mapToVSTRange());
        //[/UserSliderCode_s_LCC]
    }
    else if (sliderThatWasMoved == s_RCC)
    {
        //[UserSliderCode_s_RCC] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kCCR,s_RCC->mapToVSTRange());
        //[/UserSliderCode_s_RCC]
    }
    else if (sliderThatWasMoved == s_Channel)
    {
        //[UserSliderCode_s_Channel] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kChannel,s_Channel->mapToVSTRange());
        //[/UserSliderCode_s_Channel]
    }
    else if (sliderThatWasMoved == s_Rate)
    {
        //[UserSliderCode_s_Rate] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kRate,s_Rate->mapToVSTRange());
        //[/UserSliderCode_s_Rate]
    }
    else if (sliderThatWasMoved == s_Inertia)
    {
        //[UserSliderCode_s_Inertia] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kSmooth,s_Inertia->mapToVSTRange());
        //[/UserSliderCode_s_Inertia]
    }
    else if (sliderThatWasMoved == s_Gain)
    {
        //[UserSliderCode_s_Gain] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kGain,(float)(s_Gain->getValue())/maxGain);
        //[/UserSliderCode_s_Gain]
    }
    else if (sliderThatWasMoved == s_IndicatorL)
    {
        //[UserSliderCode_s_IndicatorL] -- add your slider handling code here..
        //[/UserSliderCode_s_IndicatorL]
    }
    else if (sliderThatWasMoved == s_IndicatorR)
    {
        //[UserSliderCode_s_IndicatorR] -- add your slider handling code here..
        //[/UserSliderCode_s_IndicatorR]
    }
    else if (sliderThatWasMoved == s_Attack)
    {
        //[UserSliderCode_s_Attack] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kAttack,s_Attack->mapToVSTRange());
        //[/UserSliderCode_s_Attack]
    }
    else if (sliderThatWasMoved == s_Release)
    {
        //[UserSliderCode_s_Release] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kRelease,s_Release->mapToVSTRange());
        //[/UserSliderCode_s_Release]
    }
    else if (sliderThatWasMoved == s_GateLCC)
    {
        //[UserSliderCode_s_GateLCC] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kGateCCL,s_GateLCC->mapToVSTRange());
        //[/UserSliderCode_s_GateLCC]
    }
    else if (sliderThatWasMoved == s_GateCCR)
    {
        //[UserSliderCode_s_GateCCR] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kGateCCR,s_GateCCR->mapToVSTRange());
        //[/UserSliderCode_s_GateCCR]
    }
    else if (sliderThatWasMoved == s_OnValueL)
    {
        //[UserSliderCode_s_OnValueL] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kGateOnValueCCL,s_OnValueL->mapToVSTRange());
        //[/UserSliderCode_s_OnValueL]
    }
    else if (sliderThatWasMoved == s_OnValueR)
    {
        //[UserSliderCode_s_OnValueR] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kGateOnValueCCR,s_OnValueR->mapToVSTRange());
        //[/UserSliderCode_s_OnValueR]
    }
    else if (sliderThatWasMoved == s_OffValueL)
    {
        //[UserSliderCode_s_OffValueL] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kGateOffValueCCL,s_OffValueL->mapToVSTRange());
        //[/UserSliderCode_s_OffValueL]
    }
    else if (sliderThatWasMoved == s_OffValueR)
    {
        //[UserSliderCode_s_OffValueR] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kGateOffValueCCR,s_OffValueR->mapToVSTRange());
        //[/UserSliderCode_s_OffValueR]
    }
    else if (sliderThatWasMoved == s_PeakGain)
    {
        //[UserSliderCode_s_PeakGain] -- add your slider handling code here..
		getFilter()->setParameterNotifyingHost(kPeakGain,(float)(s_PeakGain->getValue())/maxGain);
        //[/UserSliderCode_s_PeakGain]
    }
    else if (sliderThatWasMoved == s_IndicatorRIn)
    {
        //[UserSliderCode_s_IndicatorRIn] -- add your slider handling code here..
        //[/UserSliderCode_s_IndicatorRIn]
    }
    else if (sliderThatWasMoved == s_IndicatorLIn)
    {
        //[UserSliderCode_s_IndicatorLIn] -- add your slider handling code here..
        //[/UserSliderCode_s_IndicatorLIn]
    }

    //[UsersliderValueChanged_Post]
    //[/UsersliderValueChanged_Post]
}

void AudioToCCEditor::buttonClicked (Button* buttonThatWasClicked)
{
    //[UserbuttonClicked_Pre]
    //[/UserbuttonClicked_Pre]

    if (buttonThatWasClicked == clipR)
    {
        //[UserButtonCode_clipR] -- add your button handler code here..
		getFilter()->setParameter(kGateResetR,1.f);
        //[/UserButtonCode_clipR]
    }
    else if (buttonThatWasClicked == clipL)
    {
        //[UserButtonCode_clipL] -- add your button handler code here..
		getFilter()->setParameter(kGateResetL,1.f);
        //[/UserButtonCode_clipL]
    }
    else if (buttonThatWasClicked == b_Stereo)
    {
        //[UserButtonCode_b_Stereo] -- add your button handler code here..
		getFilter()->setParameterNotifyingHost(kStereo,b_Stereo->getToggleState() ? 1.f : 0.f);
        //[/UserButtonCode_b_Stereo]
    }
    else if (buttonThatWasClicked == toggleButton)
    {
        //[UserButtonCode_toggleButton] -- add your button handler code here..
		getFilter()->setParameterNotifyingHost(kAutomateHost,toggleButton->getToggleState() ? 1.f : 0.f);
        //[/UserButtonCode_toggleButton]
    }
    else if (buttonThatWasClicked == toggleButton2)
    {
        //[UserButtonCode_toggleButton2] -- add your button handler code here..
		getFilter()->setParameterNotifyingHost(kMidiToHost,toggleButton2->getToggleState() ? 1.f : 0.f);
        //[/UserButtonCode_toggleButton2]
    }
    else if (buttonThatWasClicked == b_Mode)
    {
        //[UserButtonCode_b_Mode] -- add your button handler code here..
		getFilter()->setParameterNotifyingHost(kMode,b_Mode->getToggleState() ? 1.f : 0.f);
        //[/UserButtonCode_b_Mode]
    }

    //[UserbuttonClicked_Post]
    //[/UserbuttonClicked_Post]
}

void AudioToCCEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
{
    //[UsercomboBoxChanged_Pre]
    //[/UsercomboBoxChanged_Pre]

    if (comboBoxThatHasChanged == comboBox)
    {
        //[UserComboBoxCode_comboBox] -- add your combo box handling code here..
		if (comboBox->getSelectedItemIndex()==0) {
			getFilter()->setParameter(kDevice,0.0f);
			getFilter()->setActiveDevice(comboBox->getText());
		}
		else {
			getFilter()->setActiveDevice(comboBox->getText());
			//getFilter()->setParameter(0,float(comboBox->getSelectedItemIndex()-1)/float(getFilter()->devices.size()-1)+0.00001f);
		}
        //[/UserComboBoxCode_comboBox]
    }

    //[UsercomboBoxChanged_Post]
    //[/UsercomboBoxChanged_Post]
}



//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
void AudioToCCEditor::changeListenerCallback (ChangeBroadcaster* source)
{
	if (source==getFilter())
		updateParametersFromFilter();
}

void AudioToCCEditor::updateParametersFromFilter()
{
    AudioToCC* const filter = getFilter();

	float p[numParams];
    filter->getCallbackLock().enter();
    const int newDevice = filter->devices.indexOf(filter->getActiveDevice());
	for (int i=0;i<numParams;i++)
		p[i] = filter->getParameter(i);
	const int ccL = filter->lastCCL;
	const int ccR = filter->lastCCR;
    filter->getCallbackLock().exit();

	s_Gain->setValue(p[kGain] * maxGain);
	s_PeakGain->setValue(p[kPeakGain] * maxGain);
	s_LCC->setVSTSlider(p[kCCL]);
	s_RCC->setVSTSlider(p[kCCR]);
    s_Channel->setVSTSlider(p[kChannel]);
    s_Rate->setVSTSlider(p[kRate]);
    s_Inertia->setVSTSlider(p[kSmooth]);
    s_Attack->setVSTSlider(p[kAttack]);
    s_Release->setVSTSlider(p[kRelease]);
    s_GateLCC->setVSTSlider(p[kGateCCL]);
    s_GateCCR->setVSTSlider(p[kGateCCR]);
    s_OnValueL->setVSTSlider(p[kGateOnValueCCL]);
    s_OnValueR->setVSTSlider(p[kGateOnValueCCR]);
    s_OffValueL->setVSTSlider(p[kGateOffValueCCL]);
    s_OffValueR->setVSTSlider(p[kGateOffValueCCR]);
	s_Thresh->setValue(p[kGateThreshold]);

    comboBox->setSelectedItemIndex(newDevice+1,true);
    toggleButton->setToggleState(p[kAutomateHost]>=0.5f,false);
    toggleButton2->setToggleState(p[kMidiToHost]>=0.5f,false);
	b_Stereo->setToggleState(p[kStereo]>=0.5f,false);
	b_Stereo->setButtonText(p[kStereo]>=0.5f ? "Stereo" : "Mono (L+R)");
	b_Mode->setToggleState(p[kMode]>=0.5f,false);
	b_Mode->setButtonText(p[kMode]>=0.5f ? "Logarithmic" : "Linear");
}

void AudioToCCEditor::timerCallback()
{
    getFilter()->getCallbackLock().enter();
	const int ccL = getFilter()->lastCCL;
	const int ccR = getFilter()->lastCCR;
	const float inL = getFilter()->lastInL;
	const float inR = getFilter()->lastInR;
	const bool gateL = getFilter()->lastGateCCL;
	const bool gateR = getFilter()->lastGateCCR;
    getFilter()->getCallbackLock().exit();

	s_IndicatorL->setValue(ccL,false);
	s_IndicatorR->setValue(ccR,false);
	s_IndicatorLIn->setValue(inL,false);
	s_IndicatorRIn->setValue(inR,false);
	++peakcounter;
	if (peakcounter==2)
	{
		peakcounter=0;
		clipL->setToggleState(gateL,false);
		clipR->setToggleState(gateR,false);
	}
	else {
		if (gateL)
			clipL->setToggleState(true,false);
		if (gateR)
			clipR->setToggleState(true,false);
	}
}
//[/MiscUserCode]


//==============================================================================
#if 0
/*  -- Jucer information section --

    This is where the Jucer puts all of its metadata, so don't change anything in here!

BEGIN_JUCER_METADATA

<JUCER_COMPONENT documentType="Component" className="AudioToCCEditor" componentName=""
                 parentClasses="public AudioProcessorEditor, public ChangeListener, public ButtonListener, public ComboBoxListener, public SliderListener, public Timer"
                 constructorParams="AudioToCC* const ownerFilter" variableInitialisers="AudioProcessorEditor (ownerFilter)"
                 snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330000013"
                 fixedSize="1" initialWidth="528" initialHeight="312">
  <BACKGROUND backgroundColour="ffd8d8d8">
    <ROUNDRECT pos="24 8 168 48" cornerSize="10" fill="solid: ffffffff" hasStroke="0"/>
    <ROUNDRECT pos="32 16 152 32" cornerSize="10" fill="solid: ff000000" hasStroke="0"/>
    <ROUNDRECT pos="224 8 296 296" cornerSize="10" fill="solid: ffb6b6b6" hasStroke="0"/>
    <ROUNDRECT pos="363 82 149 214" cornerSize="10" fill="solid: ff9a9a9a" hasStroke="0"/>
    <ROUNDRECT pos="235 82 120 214" cornerSize="10" fill="solid: ff9a9a9a" hasStroke="0"/>
    <TEXT pos="235 76 117 30" fill="solid: ff000000" hasStroke="0" text="Continuous"
          fontname="Default font" fontsize="15" bold="1" italic="0" justification="36"/>
    <TEXT pos="363 76 149 30" fill="solid: ff000000" hasStroke="0" text="Gate"
          fontname="Default font" fontsize="15" bold="1" italic="0" justification="36"/>
    <TEXT pos="40 16 136 16" fill="solid: ffffffff" hasStroke="0" text="Insert Piz Here-&gt;"
          fontname="Default font" fontsize="11.2" bold="1" italic="0" justification="36"/>
    <TEXT pos="235 2 277 30" fill="solid: ff000000" hasStroke="0" text="MIDI"
          fontname="Default font" fontsize="15" bold="1" italic="0" justification="36"/>
    <TEXT pos="40 26 136 24" fill="solid: ffffffff" hasStroke="0" text="AudioToCC"
          fontname="Default font" fontsize="15" bold="1" italic="0" justification="36"/>
    <ROUNDRECT pos="24 66 168 110" cornerSize="10" fill="solid: ff9a9a9a" hasStroke="0"/>
    <TEXT pos="27 60 165 30" fill="solid: ff000000" hasStroke="0" text="Gain"
          fontname="Default font" fontsize="15" bold="1" italic="0" justification="36"/>
  </BACKGROUND>
  <SLIDER name="slider" id="823450fac3f64450" memberName="s_Thresh" virtualName="DecibelSlider"
          explicitFocusOrder="0" pos="32 182 152 45" min="0" max="1" int="0"
          style="LinearBar" textBoxPos="TextBoxBelow" textBoxEditable="0"
          textBoxWidth="80" textBoxHeight="20" skewFactor="0.6"/>
  <LABEL name="new label" id="408faf055a8f09b" memberName="label20" virtualName=""
         explicitFocusOrder="0" pos="112 134 72 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Peak" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="36"/>
  <TEXTBUTTON name="new button" id="18e6c8407abe4977" memberName="clipR" virtualName=""
              explicitFocusOrder="0" pos="183 211 33 16" bgColOn="ffc33333"
              textCol="ffffffff" buttonText="gate" connectedEdges="1" needsCallback="1"
              radioGroupId="0"/>
  <TEXTBUTTON name="new button" id="1676a9267ec47ccf" memberName="clipL" virtualName=""
              explicitFocusOrder="0" pos="183 182 33 16" bgColOn="ffc33333"
              textCol="ffffffff" textColOn="ff000000" buttonText="gate" connectedEdges="1"
              needsCallback="1" radioGroupId="0"/>
  <COMBOBOX name="new combo box" id="a04840c19e04d837" memberName="comboBox"
            virtualName="" explicitFocusOrder="0" pos="280 41 194 16" tooltip="Output Device"
            editable="0" layout="33" items="" textWhenNonSelected="--" textWhenNoItems="(no choices)"/>
  <SLIDER name="LCC slider" id="71fcaacdd19b819a" memberName="s_LCC" virtualName="VSTSlider"
          explicitFocusOrder="0" pos="272 104 72 16" min="-1" max="127"
          int="1" style="LinearBar" textBoxPos="TextBoxBelow" textBoxEditable="1"
          textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <SLIDER name="RCC slider" id="1ebfa8346656c622" memberName="s_RCC" virtualName="VSTSlider"
          explicitFocusOrder="0" pos="272 128 72 16" min="-1" max="127"
          int="1" style="LinearBar" textBoxPos="TextBoxBelow" textBoxEditable="1"
          textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <SLIDER name="channel slider" id="f2742b92b455391" memberName="s_Channel"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="312 61 72 16"
          min="1" max="16" int="1" style="LinearBar" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <TEXTBUTTON name="mono/stereo" id="cc33b9af97a255fa" memberName="b_Stereo"
              virtualName="" explicitFocusOrder="0" pos="400 61 72 16" bgColOn="ffbbbbff"
              buttonText="Stereo" connectedEdges="0" needsCallback="1" radioGroupId="0"/>
  <SLIDER name="rate slider" id="d404e81338e76f73" memberName="s_Rate"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="248 240 40 48"
          min="0" max="100" int="1" style="RotaryVerticalDrag" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="16" skewFactor="1"/>
  <SLIDER name="inertia slider" id="738b8b242a96bb71" memberName="s_Inertia"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="296 240 40 48"
          min="0" max="100" int="1" style="RotaryVerticalDrag" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="16" skewFactor="1"/>
  <LABEL name="new label" id="6c723bc2831142a7" memberName="label" virtualName=""
         explicitFocusOrder="0" pos="275 29 150 8" edTextCol="ff000000"
         edBkgCol="0" labelText="MIDI Out Device:" editableSingleClick="0"
         editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
         fontsize="12" bold="0" italic="0" justification="33"/>
  <LABEL name="new label" id="6ef5efe574b69b48" memberName="label2" virtualName=""
         explicitFocusOrder="0" pos="32 132 72 16" edTextCol="ff000000"
         edBkgCol="0" labelText="RMS" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="36"/>
  <LABEL name="new label" id="340f799e1ecceeec" memberName="label3" virtualName=""
         explicitFocusOrder="0" pos="232 104 40 16" edTextCol="ff000000"
         edBkgCol="0" labelText="L CC:" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="e023036ab79cf561" memberName="label4" virtualName=""
         explicitFocusOrder="0" pos="232 128 40 16" edTextCol="ff000000"
         edBkgCol="0" labelText="R CC:" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="3d56114808131b06" memberName="label5" virtualName=""
         explicitFocusOrder="0" pos="272 61 40 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Ch:" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="b12b0b77f888ceac" memberName="label6" virtualName=""
         explicitFocusOrder="0" pos="248 224 40 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Rate" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="36"/>
  <SLIDER name="gain slider" id="60f4dbdc28325f06" memberName="s_Gain"
          virtualName="DecibelSlider" explicitFocusOrder="0" pos="32 78 72 88"
          min="0" max="32" int="0" style="RotaryVerticalDrag" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="16" skewFactor="0.333"/>
  <LABEL name="new label" id="cca1fb27662e9234" memberName="label7" virtualName=""
         explicitFocusOrder="0" pos="288 224 56 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Inertia" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="36"/>
  <SLIDER name="new slider" id="14cd913f745933b0" memberName="s_IndicatorL"
          virtualName="" explicitFocusOrder="0" pos="32 236 152 24" bkgcol="ff000000"
          thumbcol="ff7e7434" textboxtext="ffffffff" min="0" max="127"
          int="1" style="LinearBar" textBoxPos="TextBoxLeft" textBoxEditable="0"
          textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <SLIDER name="new slider" id="330ac78fbebd8364" memberName="s_IndicatorR"
          virtualName="" explicitFocusOrder="0" pos="32 262 152 24" bkgcol="ff000000"
          thumbcol="ff7e7434" textboxtext="ffffffff" min="0" max="127"
          int="1" style="LinearBar" textBoxPos="TextBoxLeft" textBoxEditable="0"
          textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <TOGGLEBUTTON name="new toggle button" id="c7244283a62de40d" memberName="toggleButton"
                virtualName="" explicitFocusOrder="0" pos="48 288 120 16" buttonText="Automation to host"
                connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
  <TOGGLEBUTTON name="new toggle button" id="d7b9270f0071e0c2" memberName="toggleButton2"
                virtualName="" explicitFocusOrder="0" pos="384 25 88 16" buttonText="MIDI to host"
                connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
  <SLIDER name="attack slider" id="a52f94145d8acc90" memberName="s_Attack"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="248 168 40 48"
          min="0" max="100" int="1" style="RotaryVerticalDrag" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="16" skewFactor="1"/>
  <SLIDER name="release slider" id="2f8489f087333f83" memberName="s_Release"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="296 168 40 48"
          min="0" max="100" int="1" style="RotaryVerticalDrag" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="16" skewFactor="1"/>
  <LABEL name="new label" id="b9436352365500ec" memberName="label8" virtualName=""
         explicitFocusOrder="0" pos="240 152 56 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Attack" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="36"/>
  <LABEL name="new label" id="405ea789fca9617b" memberName="label9" virtualName=""
         explicitFocusOrder="0" pos="288 152 56 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Release" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="36"/>
  <TEXTBUTTON name="dB" id="bb20e2ed360643cf" memberName="b_Mode" virtualName=""
              explicitFocusOrder="0" pos="244 -21 80 16" bgColOn="ffbbbbff"
              buttonText="Logarithmic" connectedEdges="0" needsCallback="1"
              radioGroupId="0"/>
  <LABEL name="new label" id="dd3011facb5b4850" memberName="label10" virtualName=""
         explicitFocusOrder="0" pos="196 -21 46 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Scale:" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="1ee6592a17755252" memberName="label11" virtualName=""
         explicitFocusOrder="0" pos="16 240 16 16" edTextCol="ff000000"
         edBkgCol="0" labelText="L" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="dd6c3c6feae41d30" memberName="label12" virtualName=""
         explicitFocusOrder="0" pos="16 266 16 16" edTextCol="ff000000"
         edBkgCol="0" labelText="R" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <SLIDER name="LCC slider" id="d5e457f417b75de0" memberName="s_GateLCC"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="432 136 72 16"
          min="-1" max="127" int="1" style="LinearBar" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <SLIDER name="RCC slider" id="e0e3717fd4efa33d" memberName="s_GateCCR"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="432 216 72 16"
          min="-1" max="127" int="1" style="LinearBar" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <LABEL name="new label" id="ac48f93040782198" memberName="label13" virtualName=""
         explicitFocusOrder="0" pos="368 136 64 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Gate L CC:" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="4fe98004d25fec5b" memberName="label14" virtualName=""
         explicitFocusOrder="0" pos="368 216 64 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Gate R CC:" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <SLIDER name="LCC slider" id="bbf1f7a3818fe30" memberName="s_OnValueL"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="432 160 72 16"
          min="-1" max="127" int="1" style="LinearBar" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <SLIDER name="RCC slider" id="bf7c945199e1932b" memberName="s_OnValueR"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="432 240 72 16"
          min="-1" max="127" int="1" style="LinearBar" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <LABEL name="new label" id="f48f3d6c3af0675e" memberName="label15" virtualName=""
         explicitFocusOrder="0" pos="360 160 72 16" edTextCol="ff000000"
         edBkgCol="0" labelText="On Value L:" editableSingleClick="0"
         editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
         fontsize="12" bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="b22f446661cc8441" memberName="label16" virtualName=""
         explicitFocusOrder="0" pos="360 240 72 16" edTextCol="ff000000"
         edBkgCol="0" labelText="On Value R:" editableSingleClick="0"
         editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
         fontsize="12" bold="0" italic="0" justification="34"/>
  <SLIDER name="LCC slider" id="6d98a3dac1c63181" memberName="s_OffValueL"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="432 184 72 16"
          min="-1" max="127" int="1" style="LinearBar" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <SLIDER name="RCC slider" id="2e76cd038f25b4cd" memberName="s_OffValueR"
          virtualName="VSTSlider" explicitFocusOrder="0" pos="432 264 72 16"
          min="-1" max="127" int="1" style="LinearBar" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
  <LABEL name="new label" id="b218aad886b11a5f" memberName="label17" virtualName=""
         explicitFocusOrder="0" pos="352 184 80 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Off Value L:" editableSingleClick="0"
         editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
         fontsize="12" bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="bce9fa74698943f7" memberName="label18" virtualName=""
         explicitFocusOrder="0" pos="352 264 80 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Off Value R:" editableSingleClick="0"
         editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
         fontsize="12" bold="0" italic="0" justification="34"/>
  <LABEL name="new label" id="1a296eabc3802958" memberName="label19" virtualName=""
         explicitFocusOrder="0" pos="-1 196 64 16" edTextCol="ff000000"
         edBkgCol="0" labelText="Threshold:" editableSingleClick="0" editableDoubleClick="0"
         focusDiscardsChanges="0" fontname="Default font" fontsize="12"
         bold="0" italic="0" justification="34"/>
  <SLIDER name="gain slider" id="e893dbc7f028806a" memberName="s_PeakGain"
          virtualName="DecibelSlider" explicitFocusOrder="0" pos="112 78 72 88"
          min="0" max="32" int="0" style="RotaryVerticalDrag" textBoxPos="TextBoxBelow"
          textBoxEditable="1" textBoxWidth="80" textBoxHeight="16" skewFactor="0.333"/>
  <SLIDER name="new slider" id="6781186ed706f895" memberName="s_IndicatorRIn"
          virtualName="DecibelMeter" explicitFocusOrder="0" pos="32 211 152 16"
          bkgcol="ff000000" thumbcol="ff347e4c" textboxtext="ffffffff"
          min="0" max="1" int="0" style="LinearBar" textBoxPos="TextBoxLeft"
          textBoxEditable="0" textBoxWidth="80" textBoxHeight="20" skewFactor="0.6"/>
  <SLIDER name="new slider" id="ea85cd5620a96fd3" memberName="s_IndicatorLIn"
          virtualName="DecibelMeter" explicitFocusOrder="0" pos="32 182 152 16"
          bkgcol="ff000000" thumbcol="ff347e4c" textboxtext="ffffffff"
          min="0" max="1" int="0" style="LinearBar" textBoxPos="TextBoxLeft"
          textBoxEditable="0" textBoxWidth="80" textBoxHeight="20" skewFactor="0.6"/>
</JUCER_COMPONENT>

END_JUCER_METADATA
*/
#endif
